# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.TPU.V2.Model.MultisliceParams do
  @moduledoc """
  Parameters to specify for multislice QueuedResource requests. This message must be populated in case of multislice requests instead of node_id.

  ## Attributes

  *   `nodeCount` (*type:* `integer()`, *default:* `nil`) - Required. Number of nodes with this spec. The system will attempt to provision "node_count" nodes as part of the request. This needs to be > 1.
  *   `nodeIdPrefix` (*type:* `String.t`, *default:* `nil`) - Optional. Prefix of node_ids in case of multislice request. Should follow the `^[A-Za-z0-9_.~+%-]+$` regex format. If node_count = 3 and node_id_prefix = "np", node ids of nodes created will be "np-0", "np-1", "np-2". If this field is not provided we use queued_resource_id as the node_id_prefix.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :nodeCount => integer() | nil,
          :nodeIdPrefix => String.t() | nil
        }

  field(:nodeCount)
  field(:nodeIdPrefix)
end

defimpl Poison.Decoder, for: GoogleApi.TPU.V2.Model.MultisliceParams do
  def decode(value, options) do
    GoogleApi.TPU.V2.Model.MultisliceParams.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.TPU.V2.Model.MultisliceParams do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
